package com.tencent.examples.blueking.mongo.repository;

import com.tencent.examples.blueking.mongo.model.ObjectBase;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.repository.query.QueryByExampleExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ObjectBaseRepository extends MongoRepository<ObjectBase, String>, QueryByExampleExecutor<ObjectBase> {

        @Query(value = "{" +
            "    bk_obj_id:?0,\n" +
            "    store_status:?1\n" +
            "}")
        List<ObjectBase> findObjectBaseTotal(String bk_obj_id, String store_status);

        @Query("{ 'bk_obj_id' : ?0 }")
        List<ObjectBase> findObjectBaseByBk_obj_id(String bk_obj_id);
}
